<!--浏览历史-->
<template>
  <div>
    <h1>浏览历史</h1>
    <el-timeline v-for="(item, index) in histories" :key="index">
      <el-timeline-item :timestamp="item.using_time"></el-timeline-item>
      <el-card>
        <p  v-for="(i,j) in item.seed_words" :key="j" style="width: 300px;padding-bottom: 1em">
          关键词：<el-button type="primary">{{ i.name }}</el-button>
        </p>
      </el-card>
    </el-timeline>
  </div>
</template>
<script>
  import axios from 'axios';

  export default {
    data() {
      return {
        histories: [],
      };
    },
    mounted() {
      axios({
        method: 'get',
        url: 'http://127.0.0.1:4523/m1/3571383-0-default/api/history',
      })
        .then((res) => {
          console.log('请求成功');
          console.log(res);
          this.histories = res.data.histories;
        })
        .catch((error) => {
          console.log('请求失败');
          console.log('error');
        });
    },
  };
</script>
